/*    */ package net.gxf.java2dgame.move;
/*    */ 
/*    */ import java.awt.Color;
/*    */ import java.awt.Graphics;
/*    */ import java.awt.Graphics2D;
/*    */ import java.awt.Toolkit;
/*    */ import java.awt.event.ActionEvent;
/*    */ import java.awt.event.ActionListener;
/*    */ import java.awt.event.KeyAdapter;
/*    */ import java.awt.event.KeyEvent;
/*    */ import javax.swing.JPanel;
/*    */ import javax.swing.Timer;
/*    */ 
/*    */ public class Board extends JPanel
/*    */   implements ActionListener
/*    */ {
/*    */   private Timer timer;
/*    */   private Craft craft;
/*    */ 
/*    */   public Board()
/*    */   {
/* 21 */   //  addKeyListener(new TAdapter(null));
/* 22 */     setFocusable(true);
/* 23 */     setBackground(Color.BLACK);
/* 24 */     setDoubleBuffered(true);
/*    */ 
/* 26 */     this.craft = new Craft();
/*    */ 
/* 28 */     this.timer = new Timer(5, this);
/* 29 */     this.timer.start();
/*    */   }
/*    */ 
/*    */   public void paint(Graphics g)
/*    */   {
/* 34 */     super.paint(g);
/*    */ 
/* 36 */     Graphics2D g2d = (Graphics2D)g;
/* 37 */     g2d.drawImage(this.craft.getImage(), this.craft.getX(), this.craft.getY(), this);
/*    */ 
/* 39 */     Toolkit.getDefaultToolkit().sync();
/* 40 */     g.dispose();
/*    */   }
/*    */ 
/*    */   public void actionPerformed(ActionEvent e)
/*    */   {
/* 45 */     this.craft.move();
/* 46 */     repaint();
/*    */   }
/*    */   private class TAdapter extends KeyAdapter {
/*    */     private TAdapter() {
/*    */     }
/*    */ 
/*    */     public void keyReleased(KeyEvent e) {
/* 53 */       Board.this.craft.keyReleased(e);
/*    */     }
/*    */ 
/*    */     public void keyPressed(KeyEvent e) {
/* 57 */       Board.this.craft.keyPressed(e);
/*    */     }
/*    */   }
/*    */ }

/* Location:           C:\DBDownload\lwjglDemo2\lwjglDemo2\Run.jar
 * Qualified Name:     com.java2dgame.move.Board
 * JD-Core Version:    0.6.2
 */